{include file="header.html"}
<script type="text/javascript">
function selectAll(param){
    var obj = document.getElementById(param).getElementsByTagName('input');
    var obj1 = document.getElementById('h'+param);
    for (var i = 0; i < obj.length; i++ ){
          obj[i].checked = obj1.checked;
          var item = obj[i];
          var id = item.getAttribute('b');
          if(item.checked){
              $("."+ id).attr("disabled", false);
          }else{
              $("."+ id).attr("disabled", true);
          }
    }
}
$(function(){
    // $('#article_relate').click(function(){
    //     $('.relate').attr('checked', $(this).attr('checked'));
    // });
    $("[a=priv]").click(function(){
          var item = $(this)[0];
          var id = item.getAttribute('b');
          if(item.checked){
              $("."+ id).attr("disabled", false);
          }else{
              $("."+ id).attr("disabled", true);
          }
      });
});
</script>
<div id="rightTop">
  <p>{$lang.admin}</p>
  <ul class="subnav">
    <li><a class="btn1" href="index.php?app=store">{$lang.manage}</a></li>
  </ul>
</div>

<div class="mrightTop">
  <div class="fontr">{include file=page.top.html}</div>
</div>
<div class="info">
  <form method="post" enctype="multipart/form-data" id="admin_form">
    <table class="infoTable">
      <tr>
        <th class="paddingT15"> {$lang.user_name}:</th><input type="hidden" name="priv" value="priv">
        <td class="paddingT15 wordSpacing5">{$store.user_name|escape}</td>
      </tr>
       <!--{foreach from=$priv item=priv1 key=key name=privs1}-->
           <tr id="{$key}">
           <!--{if $smarty.foreach.privs1.index eq 0}-->
           <th class="paddingT15">权限管理</th>
           <!--{else}-->
           <th></th>
           <!--{/if}-->
           <td class="paddingT15 floatleft wordSpacing5" >
            <input type="checkbox" onclick="selectAll('{$key}')" id="h{$key}"><label for="h{$key}"><b>{$priv1.name}</b></label></td>
           <!--{foreach from=$priv1.child item=child key=act}-->
            <td class="paddingT15 floatleft">
            <label><input a="priv" type="checkbox" value="{$act}" b='in_{$priv1.app}_{$child.act}' name="priv[{$act}]"
            <!--{foreach from=$checked_priv item=check_priv }-->
                <!-- {if $check_priv eq $act} -->
                checked
                <!--{if $child.include}-->{assign var="show" value="true"}<!--{/if}-->
                <!-- {/if} --> 
             <!--{/foreach}-->
            >{$child.name}
            </label>
            <!--{if $child.include}-->
                <!--{foreach from=$child.include item=v}-->
                    <input type="hidden" class="in_{$priv1.app}_{$child.act}" {if $show neq "true"} disabled='' {/if} name="priv[{$v}]" value="{$v}">
                <!--{/foreach}-->
                {assign var="show" value="false"}
            <!--{/if}-->
            </td>
            <!--{/foreach}-->
            </tr>
            <!--{foreachelse}-->
            <tr class="no_data">
            <td colspan="10">{$lang.no_data}</td>
            </tr>
            <!--{/foreach}-->
      <tr>
        <th></th>
        <td class="ptb20"><input class="formbtn" type="submit" name="Submit" value="{$lang.submit}" />
          <input class="formbtn" type="reset" name="Reset" value="{$lang.reset}" />        </td>
      </tr>
    </table>
  </form>
</div>
{include file="footer.html"} 